package com.yhos.platform.oopston.core.convert;

import com.yhos.platform.oopston.core.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.AbstractConverter;

import java.util.Date;

public class String2DateConverter extends AbstractConverter<String, Date> {

    @Override
    protected Date convert(String source) {
        return StringUtils.isBlank(source) ? null : DateUtils.stringToDate(source, DateUtils.FORMAT);
    }

}
